package com.gjy.pd.specification;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-01-17 14:38:09
 */
public class NotSpecification extends CompositeSpecification {

    private ISpecification spec;

    public NotSpecification(ISpecification spec) {
        this.spec = spec;
    }

    @Override
    public boolean isSatisfiedBy(Object candidate) {
        return !spec.isSatisfiedBy(candidate);
    }
}
